{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/components/Modal/index.tsx\";\nimport React from 'react';\nimport ReactDOM from \"react-dom\";\nimport \"./Modal.scss\";\nimport { Button } from \"../index\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nimport { Fragment as _Fragment } from \"react/jsx-dev-runtime\";\nconst Modal = _ref => {\n  let {\n    active,\n    title,\n    hasFunctionButtons = false,\n    onSubmit,\n    onClose,\n    children\n  } = _ref;\n  if (active) {\n    return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"modal\",\n      onClick: onClose,\n      children: /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"modal__content\",\n        onClick: event => event.stopPropagation(),\n        children: [/*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"modal__header\",\n          children: /*#__PURE__*/_jsxDEV(\"div\", {\n            className: \"modal__title\",\n            children: title\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 13,\n            columnNumber: 25\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 12,\n          columnNumber: 21\n        }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"modal__body\",\n          children: children\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 15,\n          columnNumber: 21\n        }, this), hasFunctionButtons && /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"modal__footer\",\n          children: [/*#__PURE__*/_jsxDEV(Button, {\n            fullWidth: false,\n            text: 'Отмена',\n            customClassName: \"modal__button\",\n            callback: onClose\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 18,\n            columnNumber: 29\n          }, this), /*#__PURE__*/_jsxDEV(Button, {\n            fullWidth: false,\n            text: 'Подтвердить',\n            customClassName: \"modal__button\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 24,\n            columnNumber: 29\n          }, this)]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 17,\n          columnNumber: 25\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 11,\n        columnNumber: 17\n      }, this)\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 10,\n      columnNumber: 13\n    }, this));\n  } else {\n    return /*#__PURE__*/_jsxDEV(_Fragment, {}, void 0, false);\n  }\n};\n_c = Modal;\nexport default Modal;\nvar _c;\n$RefreshReg$(_c, \"Modal\");","map":{"version":3,"names":["React","ReactDOM","Button","Modal","active","title","hasFunctionButtons","onSubmit","onClose","children","createPortal","event","stopPropagation"],"sources":["/data/messenger.client/src/components/Modal/index.tsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from \"react-dom\";\nimport {IModalProps} from \"../../models/props/IModalProps\";\nimport \"./Modal.scss\";\nimport {Button} from \"../index\";\n\nconst Modal: React.FC <React.PropsWithChildren<IModalProps>> = ({active, title, hasFunctionButtons = false, onSubmit, onClose, children}) => {\n    if (active) {\n        return ReactDOM.createPortal((\n            <div className=\"modal\" onClick={onClose}>\n                <div className=\"modal__content\" onClick={event => event.stopPropagation()}>\n                    <div className=\"modal__header\">\n                        <div className=\"modal__title\">{title}</div>\n                    </div>\n                    <div className=\"modal__body\">{children}</div>\n                    {(hasFunctionButtons &&\n                        <div className=\"modal__footer\">\n                            <Button\n                                fullWidth={false}\n                                text={'Отмена'}\n                                customClassName={\"modal__button\"}\n                                callback={onClose}\n                            />\n                            <Button fullWidth={false} text={'Подтвердить'} customClassName={\"modal__button\"} />\n                        </div>\n                    )}\n                </div>\n            </div>\n        ));\n    } else {\n        return (<></>);\n    }\n}\n\nexport default Modal;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,WAAW;AAEhC,OAAO,cAAc;AACrB,SAAQC,MAAM,QAAO,UAAU;AAAC;AAAA;AAEhC,MAAMC,KAAsD,GAAG,QAA8E;EAAA,IAA7E;IAACC,MAAM;IAAEC,KAAK;IA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